package com.showsu.editor.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author: William
 * @Description: 调用的外部接口平台枚举
 * @Date: Created in 7:34 下午 2023/11/23
 * @Modified By:
 */
@Getter
@AllArgsConstructor
public enum RemoteInterfacePlatformEnum {

    BATMKEY_PRIVATE(0, "batmkey私享"),
    BATMKEY_PUBLIC(1, "batmkey公用"),
    R52(2, "R52"),
    APIFOX(3, "Apifox"),
    TIKHUB(4, "Tikhub"),
    R124(5, "R124"),
    DATASHOP(6, "datashop"),
    MOREAPIPRO(7, "MoreAPIPro"),
    VNIL(8, "Vnil"),
    GONGFUMAO(9, "Gongfumao"),
    BOY235(10, "Boy235"),
    SOCIALSCRAPE(11, "socialscrape"),
    APPTIMES(12, "apptimes"),
    SELFAPI(13, "SelfAPI"),
    R202(14, "R202"),
    APIOK(15, "apiok"),
    DATAPI(20, "datapi"),
    TUTUAPI(21, "tutuApi"),
    APISERVER(22, "apiserver"),
    LOCAL(88, "local"),
    DEFAULT(99, "default"),
    ;

    /**
     * 编码
     */
    final int code;

    /**
     * 描述
     */
    final String desc;

    public static RemoteInterfacePlatformEnum getByCode(Integer code) {
        if (code != null) {
            for (RemoteInterfacePlatformEnum platformEnum : RemoteInterfacePlatformEnum.values()) {
                if (code.equals(platformEnum.getCode())) {
                    return platformEnum;
                }
            }
        }
        return BATMKEY_PRIVATE;
    }
}
